<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>箭头函数细节</h1>
    <ul>
        <li>箭头函数不能使用arguments对象</li>
        <li>箭头函数不能用作于构造函数</li>
        <li>箭头函数自身没有this指针</li>
        <li>如果箭头函数的方法体只有一行，且返回一个对象。那么会有语法歧义，此时使用()括住方法体。</li>
    </ul>
    <script>
        let sum = (a,b) => {
            // 箭头函数不能使用arguments对象
            // console.log(arguments);
            console.log(a + b);
        }

        let createObject = (name = "降龙狂魔",age = 18) => ({name:name,age: age})



        sum(1,2);
        let obj = createObject("奉先",35);
        console.log(obj);

        obj = createObject();
        console.log(obj);

    </script>
</body>
</html>